package com.theo.service.impl;

import com.theo.entity.PatientInfo;
import com.theo.mapper.PatientInfoMapper;
import com.theo.service.PatientInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 方涛
 * @since 2021-02-02
 */
@Service
public class PatientInfoServiceImpl extends ServiceImpl<PatientInfoMapper, PatientInfo> implements PatientInfoService {

    @Autowired
    private PatientInfoMapper patientInfoMapper;
    @Override
    public int savePatientInfo(PatientInfo patientInfo) {
        return patientInfoMapper.insert(patientInfo);
    }

    @Override
    public int deletePatientInfo(Integer id) {
        return patientInfoMapper.deleteById(id);
    }

    @Override
    public int updatePatientInfo(PatientInfo patientInfo) {
        return patientInfoMapper.updateById(patientInfo);
    }

    @Override
    public List<PatientInfo> queryAllPatientInfo() {
        return patientInfoMapper.queryAllPatientInfo();
    }

    @Override
    public PatientInfo queryPatientInfoById(Integer id) {
        return patientInfoMapper.selectById(id);
    }
}
